<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen">
</head>
<body>
    <div class="entry"> 
 <div id="toc">
  <strong>目录</strong>
  <span>[hide]</span> 
  <ul id="toc_l"> 
   <li><a href="#Series_arrays">序列化数组</a></li> 
   <li><a href="#Timeframes">图表时段 </a></li> 
   <li><a href="#Trade_operations">交易类型 </a></li> 
   <li><a href="#Price_constants">价格常量 </a></li> 
   <li><a href="#MarketInfo">市场信息 </a></li> 
   <li><a href="#Drawing_styles">画线样式 </a></li> 
   <li><a href="#Arrow_codes">箭头代码 </a></li> 
  </ul> 
 </div> 
 <p>为了简化程序编写，使程序文本编辑使用起来更加简便，在MQL4中预定义了标准常量。</p> 
 <p>标准常量类似于<a href="373.html#Constant_declaration">宏代换</a>，并且是<a href="368.html#Integer_constants">int(整数类型)</a>。</p> 
 <p>这些常量按用途进行分组。</p> 
 <h2><a name="Series_arrays"></a>序列化数组</h2> 
 <p>序列化数组标识符用在<a href="383.html#ArrayCopySeries">ArrayCopySeries()</a>,&nbsp; <a href="409.html#iHighest">iHighest()</a>和<a href="409.html#iLowest">iLowest()</a>函数。</p> 
 <p>可以是以下任意值:</p> 
 <table class="custom-table"> 
  <tbody> 
   <tr> 
    <th width="15%">常数</th> 
    <th width="10%">值</th> 
    <th width="75%">描述</th> 
   </tr> 
   <tr> 
    <td>MODE_OPEN</td> 
    <td>0</td> 
    <td>开盘价</td> 
   </tr> 
   <tr> 
    <td>MODE_LOW</td> 
    <td>1</td> 
    <td>最低价</td> 
   </tr> 
   <tr> 
    <td>MODE_HIGH</td> 
    <td>2</td> 
    <td>最高价</td> 
   </tr> 
   <tr> 
    <td>MODE_CLOSE</td> 
    <td>3</td> 
    <td>收盘价</td> 
   </tr> 
   <tr> 
    <td>MODE_VOLUME</td> 
    <td>4</td> 
    <td>成交量，应用在iLowest()和iHighest()函数中</td> 
   </tr> 
   <tr> 
    <td>MODE_TIME</td> 
    <td>5</td> 
    <td>开盘时间，应用在ArrayCopySeries()函数中</td> 
   </tr> 
  </tbody> 
 </table> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 
 <h2><a name="Timeframes"></a>图表时段</h2> 
 <p>图表时段(图表的时间周期)。可以是以下任意值:</p> 
 <table class="custom-table"> 
  <tbody> 
   <tr> 
    <th width="15%">常数</th> 
    <th width="10%">值</th> 
    <th width="75%">描述</th> 
   </tr> 
   <tr> 
    <td>PERIOD_M1</td> 
    <td>1</td> 
    <td>1 分钟</td> 
   </tr> 
   <tr> 
    <td>PERIOD_M5</td> 
    <td>5</td> 
    <td>5 分钟</td> 
   </tr> 
   <tr> 
    <td>PERIOD_M15</td> 
    <td>15</td> 
    <td>15 分钟</td> 
   </tr> 
   <tr> 
    <td>PERIOD_M30</td> 
    <td>30</td> 
    <td>30 分钟</td> 
   </tr> 
   <tr> 
    <td>PERIOD_H1</td> 
    <td>60</td> 
    <td>1 小时</td> 
   </tr> 
   <tr> 
    <td>PERIOD_H4</td> 
    <td>240</td> 
    <td>4 小时</td> 
   </tr> 
   <tr> 
    <td>PERIOD_D1</td> 
    <td>1440</td> 
    <td>日</td> 
   </tr> 
   <tr> 
    <td>PERIOD_W1</td> 
    <td>10080</td> 
    <td>周</td> 
   </tr> 
   <tr> 
    <td>PERIOD_MN1</td> 
    <td>43200</td> 
    <td>月</td> 
   </tr> 
   <tr> 
    <td>0 (zero)</td> 
    <td>0</td> 
    <td>采用图表中当前时段</td> 
   </tr> 
  </tbody> 
 </table> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 
 <h2><a name="Trade_operations"></a>交易类型</h2> 
 <p>用于<a href="413.html#OrderSend">OrderSend()函数</a>的交易类型。可以是以下任意值:</p> 
 <table class="custom-table"> 
  <tbody> 
   <tr> 
    <th width="15%">常数</th> 
    <th width="10%">值</th> 
    <th width="75%">描述</th> 
   </tr> 
   <tr> 
    <td>OP_BUY</td> 
    <td>0</td> 
    <td>即时成交买单</td> 
   </tr> 
   <tr> 
    <td>OP_SELL</td> 
    <td>1</td> 
    <td>即时成交卖单</td> 
   </tr> 
   <tr> 
    <td>OP_BUYLIMIT</td> 
    <td>2</td> 
    <td>限价挂单买单</td> 
   </tr> 
   <tr> 
    <td>OP_SELLLIMIT</td> 
    <td>3</td> 
    <td>限价挂单卖单</td> 
   </tr> 
   <tr> 
    <td>OP_BUYSTOP</td> 
    <td>4</td> 
    <td>止损挂单买单</td> 
   </tr> 
   <tr> 
    <td>OP_SELLSTOP</td> 
    <td>5</td> 
    <td>止损挂单卖单</td> 
   </tr> 
  </tbody> 
 </table> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 
 <h2><a name="Price_constants"></a>价格常量</h2> 
 <p>价格常量，它可以是以下的任意值:</p> 
 <table class="custom-table"> 
  <tbody> 
   <tr> 
    <th width="15%">常数</th> 
    <th width="10%">值</th> 
    <th width="75%">描述</th> 
   </tr> 
   <tr> 
    <td>PRICE_CLOSE</td> 
    <td>0</td> 
    <td>收盘价</td> 
   </tr> 
   <tr> 
    <td>PRICE_OPEN</td> 
    <td>1</td> 
    <td>开盘价</td> 
   </tr> 
   <tr> 
    <td>PRICE_HIGH</td> 
    <td>2</td> 
    <td>最高价</td> 
   </tr> 
   <tr> 
    <td>PRICE_LOW</td> 
    <td>3</td> 
    <td>最低价</td> 
   </tr> 
   <tr> 
    <td>PRICE_MEDIAN</td> 
    <td>4</td> 
    <td>中间价(high+low)/2.</td> 
   </tr> 
   <tr> 
    <td>PRICE_TYPICAL</td> 
    <td>5</td> 
    <td>典型价格 (high+low+close)/3.</td> 
   </tr> 
   <tr> 
    <td>PRICE_WEIGHTED</td> 
    <td>6</td> 
    <td>加权收盘价 (high+low+close+close)/4.</td> 
   </tr> 
  </tbody> 
 </table> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 
 <h2><a name="MarketInfo"></a>市场信息</h2> 
 <p>市场信息常量，用在<a href="388.html#MarketInfo">MarketInfo()函数</a>。可以是以下任意值:</p> 
 <table class="custom-table"> 
  <tbody> 
   <tr> 
    <th width="15%">常数</th> 
    <th width="10%">值</th> 
    <th width="75%">描述</th> 
   </tr> 
   <tr> 
    <td>MODE_LOW</td> 
    <td>1</td> 
    <td>今日最低价。</td> 
   </tr> 
   <tr> 
    <td>MODE_HIGH</td> 
    <td>2</td> 
    <td>今日最高价。</td> 
   </tr> 
   <tr> 
    <td>MODE_TIME</td> 
    <td>5</td> 
    <td>最新接收到的tick(最新的价位)的时间 (最新知道的服务器时间)。</td> 
   </tr> 
   <tr> 
    <td>MODE_BID</td> 
    <td>9</td> 
    <td>最新收到的买价。对于当前货币对，它被保存在预定义变量 <a href="378.html#Bid">Bid</a> 中。</td> 
   </tr> 
   <tr> 
    <td>MODE_ASK</td> 
    <td>10</td> 
    <td>最新收到的卖价。对于当前货币对，它被保存在预定义变量 <a href="378.html#Ask">Ask</a> 中。</td> 
   </tr> 
   <tr> 
    <td>MODE_POINT</td> 
    <td>11</td> 
    <td>当前报价的点值。对于当前货币对，在预定义变量 <a href="378.html#Point">Point</a> 中。</td> 
   </tr> 
   <tr> 
    <td>MODE_DIGITS</td> 
    <td>12</td> 
    <td>在货币对价格中小数点后小数位数。对于当前货币对，它被保存在预定义变量 <a href="378.html#Digits">Digits</a> 中。</td> 
   </tr> 
   <tr> 
    <td>MODE_SPREAD</td> 
    <td>13</td> 
    <td>当前点差。</td> 
   </tr> 
   <tr> 
    <td>MODE_STOPLEVEL</td> 
    <td>14</td> 
    <td>可以允许的最小止损位距离点数。</td> 
   </tr> 
   <tr> 
    <td>MODE_LOTSIZE</td> 
    <td>15</td> 
    <td>基本货币的标准手大小。</td> 
   </tr> 
   <tr> 
    <td>MODE_TICKVALUE</td> 
    <td>16</td> 
    <td>当前品种报价每一跳的价值。</td> 
   </tr> 
   <tr> 
    <td>MODE_TICKSIZE</td> 
    <td>17</td> 
    <td>当前品种报价每一跳的大小。</td> 
   </tr> 
   <tr> 
    <td>MODE_SWAPLONG</td> 
    <td>18</td> 
    <td>看涨仓位掉期。</td> 
   </tr> 
   <tr> 
    <td>MODE_SWAPSHORT</td> 
    <td>19</td> 
    <td>卖空仓位掉期。</td> 
   </tr> 
   <tr> 
    <td>MODE_STARTING</td> 
    <td>20</td> 
    <td>交易开始日期 (通常用作期货）。</td> 
   </tr> 
   <tr> 
    <td>MODE_EXPIRATION</td> 
    <td>21</td> 
    <td>交易到期日 (通常用作期货)。</td> 
   </tr> 
   <tr> 
    <td>MODE_TRADEALLOWED</td> 
    <td>22</td> 
    <td>货币对是否允许交易。</td> 
   </tr> 
   <tr> 
    <td>MODE_MINLOT</td> 
    <td>23</td> 
    <td>允许交易的最小手数。</td> 
   </tr> 
   <tr> 
    <td>MODE_LOTSTEP</td> 
    <td>24</td> 
    <td>交易手数的最小增量。</td> 
   </tr> 
   <tr> 
    <td>MODE_MAXLOT</td> 
    <td>25</td> 
    <td>允许交易的最大手数。</td> 
   </tr> 
   <tr> 
    <td>MODE_SWAPTYPE</td> 
    <td>26</td> 
    <td>掉期计算方法。0 – 按点; 1 -按基准货币对; 2 – 按利率; 3 – 按保证金货币。</td> 
   </tr> 
   <tr> 
    <td>MODE_PROFITCALCMODE</td> 
    <td>27</td> 
    <td>赢利计算模式。0 – Forex(外汇); 1 – CFD(差价合约); 2 – Futrues(期货)。</td> 
   </tr> 
   <tr> 
    <td>MODE_MARGINCALCMODE</td> 
    <td>28</td> 
    <td>保证金计算模式。 0 – Forex(外汇); 1 – CFD(差价合约); 2 – Futrues(期货); 3 – CFD for indices(CFD指数)。</td> 
   </tr> 
   <tr> 
    <td>MODE_MARGININIT</td> 
    <td>29</td> 
    <td>1标准手的初始保证金需求。</td> 
   </tr> 
   <tr> 
    <td>MODE_MARGINMAINTENANCE</td> 
    <td>30</td> 
    <td>维持开仓1标准手的保证金。</td> 
   </tr> 
   <tr> 
    <td>MODE_MARGINHEDGED</td> 
    <td>31</td> 
    <td>1标准手的对冲保证金。</td> 
   </tr> 
   <tr> 
    <td>MODE_MARGINREQUIRED</td> 
    <td>32</td> 
    <td>要求买1标准手的保证金余额。</td> 
   </tr> 
   <tr> 
    <td>MODE_FREEZELEVEL</td> 
    <td>33</td> 
    <td>冻结订单的点位。如果执行价出现在冻结订单的点位范围内，订单将不能被修改会、取消或平仓。</td> 
   </tr> 
  </tbody> 
 </table> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 
 <h2><a name="Drawing_styles"></a>画线样式</h2> 
 <p><a href="392.html#SetIndexStyle">SetIndexStyle()</a>函数中画线样式的列表。</p> 
 <p>可以是以下任意值:</p> 
 <table class="custom-table"> 
  <tbody> 
   <tr> 
    <th width="15%">常数</th> 
    <th width="10%">值</th> 
    <th width="75%">描述</th> 
   </tr> 
   <tr> 
    <td>DRAW_LINE</td> 
    <td>0</td> 
    <td>线</td> 
   </tr> 
   <tr> 
    <td>DRAW_SECTION</td> 
    <td>1</td> 
    <td>线条</td> 
   </tr> 
   <tr> 
    <td>DRAW_HISTOGRAM</td> 
    <td>2</td> 
    <td>柱状图</td> 
   </tr> 
   <tr> 
    <td>DRAW_ARROW</td> 
    <td>3</td> 
    <td>箭头(货币对)。</td> 
   </tr> 
   <tr> 
    <td>DRAW_ZIGZAG</td> 
    <td>4</td> 
    <td>折线</td> 
   </tr> 
   <tr> 
    <td>DRAW_NONE</td> 
    <td>12</td> 
    <td>不画线</td> 
   </tr> 
  </tbody> 
 </table> 
 <p>画线样式，宽度为1时有效，可以是以下任意值:</p> 
 <table class="custom-table"> 
  <tbody> 
   <tr> 
    <th width="15%">常数</th> 
    <th width="10%">值</th> 
    <th width="75%">描述</th> 
   </tr> 
   <tr> 
    <td>STYLE_SOLID</td> 
    <td>0</td> 
    <td>实线</td> 
   </tr> 
   <tr> 
    <td>STYLE_DASH</td> 
    <td>1</td> 
    <td>虚线</td> 
   </tr> 
   <tr> 
    <td>STYLE_DOT</td> 
    <td>2</td> 
    <td>点线</td> 
   </tr> 
   <tr> 
    <td>STYLE_DASHDOT</td> 
    <td>3</td> 
    <td>点划线</td> 
   </tr> 
   <tr> 
    <td>STYLE_DASHDOTDOT</td> 
    <td>4</td> 
    <td>双点划线</td> 
   </tr> 
  </tbody> 
 </table> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 
 <h2><a name="Arrow_codes"></a>箭头代码</h2> 
 <p>箭头代码常量，预定义箭头代码列表。可以是以下的任意值:</p> 
 <p>&nbsp;</p> 
 <table class="custom-table"> 
  <tbody> 
   <tr> 
    <th width="15%">常数</th> 
    <th width="10%">值</th> 
    <th width="75%">描述</th> 
   </tr> 
   <tr> 
    <td>SYMBOL_THUMBSUP</td> 
    <td>67</td> 
    <td>大拇指向上符号 (<span class="wingdings">C</span>).</td> 
   </tr> 
   <tr> 
    <td>SYMBOL_THUMBSDOWN</td> 
    <td>68</td> 
    <td>大拇指向下符号 (<span class="wingdings">D</span>).</td> 
   </tr> 
   <tr> 
    <td>SYMBOL_ARROWUP</td> 
    <td>241</td> 
    <td>箭头向上符号 (<span class="wingdings">ñ</span>).</td> 
   </tr> 
   <tr> 
    <td>SYMBOL_ARROWDOWN</td> 
    <td>242</td> 
    <td>箭头向下符号 (<span class="wingdings">ò</span>).</td> 
   </tr> 
   <tr> 
    <td>SYMBOL_STOPSIGN</td> 
    <td>251</td> 
    <td>打叉符号(<span class="wingdings">û</span>).</td> 
   </tr> 
   <tr> 
    <td>SYMBOL_CHECKSIGN</td> 
    <td>252</td> 
    <td>打钩符号 (<span class="wingdings">ü</span>).</td> 
   </tr> 
  </tbody> 
 </table> 
 <p>对于价格和时间的特殊箭头代码。可以是以下任意值:</p> 
 <table class="custom-table"> 
  <tbody> 
   <tr> 
    <th width="15%">常数</th> 
    <th width="10%">值</th> 
    <th width="75%">描述</th> 
   </tr> 
   <tr> 
    <td></td> 
    <td>1</td> 
    <td>右上转箭头 (<span style="font: 12pt lucida sans unicode;">↱</span>).</td> 
   </tr> 
   <tr> 
    <td></td> 
    <td>2</td> 
    <td>右下转箭头(<span style="font: 12pt lucida sans unicode;">↳</span>).</td> 
   </tr> 
   <tr> 
    <td></td> 
    <td>3</td> 
    <td>左指向三角 (<span style="font: 12pt arial;">◄</span>).</td> 
   </tr> 
   <tr> 
    <td></td> 
    <td>4</td> 
    <td>破折号(–).</td> 
   </tr> 
   <tr> 
    <td>SYMBOL_LEFTPRICE</td> 
    <td>5</td> 
    <td>价格左侧标签</td> 
   </tr> 
   <tr> 
    <td>SYMBOL_RIGHTPRICE</td> 
    <td>6</td> 
    <td>价格右侧标签</td> 
   </tr> 
  </tbody> 
 </table> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 本文地址：
 <a href="374.html" rel="bookmark"><b>374.html</b></a> 
</div>
</body>
</html>